package cn.lanca.gof16_20._18observer.original;


import java.util.ArrayList;
import java.util.List;

/**
 * 抽象目标
 *
 * @author hongliang.mei
 * @since 2020/12/27 23:33
 */
public abstract class Subject {
    protected List<Observer> observers = new ArrayList<>();

    public void add(Observer observer) {
        observers.add(observer);
    }

    //删除观察者方法
    public void remove(Observer observer) {
        observers.remove(observer);
    }

    //通知观察者方法
    public abstract void notifyObserver();
}
